/*
 * commons is a based project implemented
 * Copyright (C) 2024 Jasmine
 */
package com.easy.core.exception;

/**
 * 应用系统级别的错误码
 *
 * @author Jasmine
 * @since 1.0.0
 */
@SuppressWarnings("all")
public enum GlobalErrorInfoEnum implements ErrorInfoInterface {

    SUCCESS(200, "操作成功"),

    FAILED(500, "操作失败"),

    SAVE_FAILED(500, "保存失败"),
    DELETE_FAILED(500, "删除失败"),
    UPDATE_FAILED(500, "更新失败"),
    QUERY_FAILED(500, "查询失败"),

    NOT_INJECT(500, "applicationContext 属性为 null,请检查是否注入了ApplicationContextHolder!"),

    NOT_SUPPORT_DB(500, "不支持当前数据库");

    private int code;
    private String message;

    GlobalErrorInfoEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
